package unq.ui.carmensandiego

import android.app.Activity
import android.content.Intent
import android.widget.Button
import android.widget.Spinner
import android.widget.Toast
import java.util.List
import java.io.Serializable

abstract class AbstractCarmenActivity extends Activity {
	
	
	public static val ESTADO_CASO = "ESTADO_CASO"
	
	def agregarAtributos(Spinner spinner,Activity context, List<String> elementos){
		spinner.adapter = new SpinnerAdapter(context, elementos)
	}
	
	def setReturnAction(Button boton, Activity context, Serializable caso){
		boton.onClickListener = [ 
			startActivity(new Intent(context, StartedGameCasoActivity) => [
				putExtra(StartedGameCasoActivity.ESTADO_CASO, caso)
			]
		)]
	}
	
	def showToastMessage(Activity context, String msg){
		Toast.makeText(context, msg, Toast.LENGTH_LONG).show
	}
}